/*
 * @version: vue3
 * @Author: lxs
 * @Date: 2022-04-30 18:53:59
 * @LastEditors: sueRimn
 * @LastEditTime: 2022-04-30 19:43:29
 */
// 定义state
export interface MenuState {
  count: number;
  collapse: boolean;
}
export const state: MenuState = {
  count: 0,
  collapse: false,
};
// 定义mutations
export const mutations = {
  setCount(state: MenuState, count: number) {
    state.count = count;
  },
  //设置collapse
  setCollapse(state: MenuState, collapse: boolean) {
    // console.log(collapse);
    state.collapse = collapse;
  },
};
export const actions = {};
export const getters = {
  getCount(state: MenuState) {
    return state.count;
  },
};
export default {
  namespace: true,
  state,
  mutations,
  actions,
  getters,
};
